package com.ruoyi.ewem.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.ewem.domain.Physical;
import com.ruoyi.ewem.domain.Warehouse;
import com.ruoyi.ewem.mapper.EwemPhysicalMapper;
import com.ruoyi.ewem.service.IEwemPhysicalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 物流运输Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-27
 */
@Service
public class EwemPhysicalServiceImpl extends ServiceImpl<EwemPhysicalMapper,Physical> implements IEwemPhysicalService
{
    @Autowired
    private EwemPhysicalMapper ewemPhysicalMapper;

    /**
     * 查询物流运输
     * 
     * @param physicalId 物流运输主键
     * @return 物流运输
     */
    @Override
    public Physical selectEwemPhysicalByPhysicalId(Long physicalId)
    {
        return ewemPhysicalMapper.selectEwemPhysicalByPhysicalId(physicalId);
    }

    /**
     * 查询物流运输列表
     * 
     * @param ewemPhysical 物流运输
     * @return 物流运输
     */
    @Override
    public List<Physical> selectEwemPhysicalList(Physical ewemPhysical)
    {
        return ewemPhysicalMapper.selectEwemPhysicalList(ewemPhysical);
    }

    /**
     * 新增物流运输
     * 
     * @param ewemPhysical 物流运输
     * @return 结果
     */
    @Override
    public int insertEwemPhysical(Physical ewemPhysical)
    {
        ewemPhysical.setCreateTime(DateUtils.getNowDate());
        return ewemPhysicalMapper.insertEwemPhysical(ewemPhysical);
    }

    /**
     * 修改物流运输
     * 
     * @param ewemPhysical 物流运输
     * @return 结果
     */
    @Override
    public int updateEwemPhysical(Physical ewemPhysical)
    {
        ewemPhysical.setUpdateTime(DateUtils.getNowDate());
        return ewemPhysicalMapper.updateEwemPhysical(ewemPhysical);
    }

    /**
     * 批量删除物流运输
     * 
     * @param physicalIds 需要删除的物流运输主键
     * @return 结果
     */
    @Override
    public int deleteEwemPhysicalByPhysicalIds(Long[] physicalIds)
    {
        return ewemPhysicalMapper.deleteEwemPhysicalByPhysicalIds(physicalIds);
    }

    /**
     * 删除物流运输信息
     * 
     * @param physicalId 物流运输主键
     * @return 结果
     */
    @Override
    public int deleteEwemPhysicalByPhysicalId(Long physicalId)
    {
        return ewemPhysicalMapper.deleteEwemPhysicalByPhysicalId(physicalId);
    }

    @Override
    public List<Warehouse> selectWarehouseList() {
        return ewemPhysicalMapper.selectWareHouseList();
    }

    @Override
    public List<Physical> selectlistByuser(String username) {

        return ewemPhysicalMapper.selectListByuser(username);
    }

    @Override
    public List<Physical> listAll() {
        return ewemPhysicalMapper.listAll();
    }
}
